package TUILayer;
import java.util.Scanner;
import ModelLayer.*;

/**
 * Write a description of class InputOutput here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public abstract class InputOutput
{

    int readInt()
    {
        Scanner keyboard = new Scanner(System.in);
        String s = keyboard.nextLine();
        
        try{
            return Integer.parseInt(s);
        }
        catch(NumberFormatException e){
            return -1;
        }
    }
    
    
    long readLong()
    {
        Scanner keyboard = new Scanner(System.in);
        String s = keyboard.nextLine();
        
        try{
            return Long.parseLong(s);
        }
        catch(NumberFormatException e){
            return -1;
        }
    }
    
    double readDouble()
    {
        Scanner keyboard = new Scanner(System.in);
        String s = keyboard.nextLine();
        
        try{
            return Double.parseDouble(s);
        }
        catch(NumberFormatException e){
            return -1;
        }
    }
    
    String readString()
    {
        Scanner keyboard = new Scanner(System.in);
        return keyboard.nextLine();
    }
    
    // ********************************************************************************** \\
    
    
    double inputDouble(String param)
    {
        System.out.print(" Write "+param+":  ");
        return (double)readDouble();
    } 
    
    
    int inputInt(String param)
    {
        System.out.print(" Write "+param+":  ");
        return (int)readInt();
    }
    
    long inputLong(String param)
    {
        System.out.print(" Write "+param+":  ");
        return (long)readLong();
    }
    
    String inputString(String param)
    {
        System.out.print(" Write "+param+":  ");
        return (String)readString();
    }
}
